<template>
  <div class="income_wrap with-grey-bottom-border">
    <ul>
      <li
        @click="
          $router.push({
            path: '/income-item-detail',
            query: { id: income.id }
          })
        "
        v-for="income in item"
      >
        <div class="income_lt">
          <div
            class="img"
            :style="{
              background: income.status === 1 ? '#0078FF' : '#F85859'
            }"
          >
            <img src="@/assets/vip-assets/红包 拷贝 2.png" alt="" />
          </div>
          <div class="incomeInfoWrap">
            <p class="income_name">
              {{ income.status === 1 ? "推荐奖励" : "购物奖励" }}
            </p>
            <p class="income_from">来源：{{ income.user.nickname }}</p>
          </div>
        </div>
        <div class="income_rt">
          <p class="income_money">￥{{ income.bonus }}</p>
          <p class="income_time">{{ income.created_at }}</p>
        </div>
        <div class="clear"></div>
      </li>
    </ul>
  </div>
</template>

<script>
export default {
  props: ["item"],
  data() {
    return {};
  }
};
</script>

<style lang="less" scoped>
.clear {
  clear: both;
}
.income_wrap {
  li {
    padding: 0.8rem 0.4rem;
    background: #ffffff;
    border-bottom: 1px solid #eeeeee;
  }
  li:last-child {
    border: none;
  }
  .income_lt {
    float: left;
    .img {
      width: 1.6rem;
      height: 1.6rem;
      border-radius: 50%;
      display: inline-block;
      text-align: center;
      vertical-align: top;
      line-height: 1.6rem;
      img {
        width: 0.68rem;
        height: 0.8rem;
        vertical-align: middle;
      }
    }
    .incomeInfoWrap {
      display: inline-block;
      margin-left: 0.4rem;
      text-align: center;
      .income_name {
        color: #444444;
        font-size: 0.64rem;
        margin-bottom: 0.3rem;
      }
      .income_from {
        color: #999999;
        font-size: 0.48rem;
        text-align: left;
      }
    }
  }
  .income_rt {
    float: right;
    .income_money {
      color: #f85859;
      font-size: 0.56rem;
      text-align: right;
      margin-bottom: 0.45rem;
    }
    .income_time {
      text-align: right;
      color: #999999;
      font-size: 0.48rem;
    }
  }
}
</style>